STEP 4: Let's use what we just learned about converting between integers and strings.

Changing the data type of a variable is called casting.

  • Go to LOGIC, click on and drag in Convert to String. Drop it at the bottom of your program.
  • Change the variable inside of str() from my_var to roll_1.
  • Change the variable to the left of the = from my_var to roll_1_string.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)